/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f7ff 100%);
    color: #333;
    line-height: 1.6;
    background-attachment: fixed;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

/* 按钮样式 */
.btn-primary, .btn-secondary, .btn-small {
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #7f8c8d 0%, #6c7a7c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(127, 140, 141, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(127, 140, 141, 0.4);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-small:active {
    transform: translateY(0);
}

/* 按钮点击波纹效果 */
.btn-primary::after, .btn-secondary::after, .btn-small::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::after, .btn-secondary:active::after, .btn-small:active::after {
    width: 200px;
    height: 200px;
}

/* 首页样式 */
.welcome-section {
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 50px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.welcome-section::after {
    content: "";
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.welcome-section h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #4a90e2;
}

.welcome-section p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #7f8c8d;
}

/* 设置页面样式 */
.settings-section {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.settings-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4a90e2;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.checkbox-group label {
    font-weight: normal;
    margin-bottom: 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.checkbox-group label:hover {
    background-color: #e9ecef;
    border-color: #4a90e2;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
}

/* 题型图标 */
.quiz-type-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.quiz-type-icon.word-image {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg>');
}

.quiz-type-icon.image-word {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg>');
}

.quiz-type-icon.word-audio {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/><path d="M12 8v8"/><path d="M8 12h8"/></svg>');
}

.quiz-type-icon.audio-word {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 15v4c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/><path d="M12 8l-4 4"/><path d="M12 8l4 4"/></svg>');
}

.quiz-type-icon.image-audio {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M21 15l-5-5L5 21"/><path d="M17 8l-4 4"/><path d="M17 8l4 4"/></svg>');
}

.quiz-type-icon.audio-image {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 15v4c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg>');
}

.range-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.level-selector, .unit-selector {
    flex: 1;
    min-width: 300px;
}

.level-selector h3, .unit-selector h3 {
    margin-bottom: 15px;
    color: #4a90e2;
}

#level-checkboxes, #unit-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

#level-checkboxes label, #unit-checkboxes label {
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

#level-checkboxes label:hover, #unit-checkboxes label:hover {
    background-color: #e9ecef;
    border-color: #4a90e2;
}

#level-checkboxes input[type="checkbox"], #unit-checkboxes input[type="checkbox"] {
    display: none;
}

#level-checkboxes input[type="checkbox"]:checked + span, 
#unit-checkboxes input[type="checkbox"]:checked + span {
    background-color: #4a90e2;
    color: white;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

/* 考试页面样式 */
.quiz-section {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 30px;
}

.timer, .progress, .score {
    font-weight: bold;
    font-size: 1.1em;
}

.timer {
    color: #e74c3c;
}

.question-container {
    text-align: center;
    margin-bottom: 30px;
}

.question-prompt {
    font-size: 1.5em;
    margin-bottom: 30px;
    color: #4a90e2;
    font-weight: bold;
}

.question-word {
    font-size: 2.5em;
    margin: 20px 0;
    color: #4a90e2;
    font-weight: bold;
    text-transform: uppercase;
}

.question-media {
    margin: 30px 0;
}

.question-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.audio-player {
    margin: 20px 0;
}

.audio-player button {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.audio-player button:hover {
    background-color: #357abd;
    transform: translateY(-2px);
}

.audio-player .speed-control {
    background-color: #3498db;
    font-size: 14px;
    padding: 8px 16px;
}

.audio-player .speed-control.active {
    background-color: #2ecc71;
}

.options-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.option {
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f8f9fa;
}

.option:hover {
    border-color: #4a90e2;
    background-color: #e9f2fc;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.option.selected {
    border-color: #4a90e2;
    background-color: #4a90e2;
    color: white;
}

.option-image {
    max-width: 100%;
    max-height: 150px;
    border-radius: 5px;
    margin-top: 10px;
}

.quiz-actions {
    text-align: center;
    margin-top: 30px;
}

/* 结果页面样式 */
.results-section {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.results-section h2 {
    color: #4a90e2;
    margin-bottom: 30px;
}

.result-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 50px;
    margin-bottom: 40px;
}

.score-display {
    flex: 1;
    min-width: 200px;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: #4a90e2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    color: white;
}

.score-circle #final-score {
    font-size: 3em;
    font-weight: bold;
}

.score-label {
    font-size: 1.2em;
}

.result-details {
    flex: 1;
    min-width: 300px;
    text-align: left;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.result-item .label {
    font-weight: bold;
    color: #4a90e2;
}

.result-actions {
    margin-top: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .welcome-section, .settings-section, .quiz-section, .results-section {
        padding: 20px;
    }
    
    .checkbox-group {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .range-selector {
        flex-direction: column;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .result-summary {
        flex-direction: column;
        gap: 30px;
    }
}

/* 答题记录页面样式 */
.records-section {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.records-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4a90e2;
}

.records-filter {
    margin-bottom: 20px;
    text-align: center;
}

.records-filter label {
    font-weight: bold;
    margin-right: 10px;
}

.records-filter select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

#records-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

#records-table th, #records-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

#records-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.records-actions {
    text-align: center;
    margin-top: 30px;
}

/* 错题本页面样式 */
.wrong-questions-section {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.wrong-questions-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4a90e2;
}

.wrong-questions-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
}

.stat-item .label {
    display: block;
    font-weight: bold;
    color: #4a90e2;
    margin-bottom: 5px;
}

.stat-item span {
    font-size: 1.5em;
    font-weight: bold;
}

.wrong-question-item {
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 15px;
    background-color: #f8f9fa;
}

.question-word {
    font-size: 1.5em;
    font-weight: bold;
    color: #4a90e2;
    margin-bottom: 10px;
}

.question-type {
    color: #7f8c8d;
    margin-bottom: 10px;
}

.question-info {
    display: flex;
    justify-content: space-between;
}

.wrong-questions-actions {
    text-align: center;
    margin-top: 30px;
}

/* 排行榜页面样式 */
.leaderboard-section {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.leaderboard-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4a90e2;
}

.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    margin-bottom: 50px;
}

.podium-item {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    color: white;
}

.podium-item.first {
    background-color: gold;
    height: 150px;
    width: 120px;
}

.podium-item.second {
    background-color: #c0c0c0;
    height: 120px;
    width: 100px;
}

.podium-item.third {
    background-color: #cd7f32;
    height: 100px;
    width: 80px;
}

.podium-rank {
    font-size: 2em;
    font-weight: bold;
}

.podium-user {
    font-size: 1.2em;
    margin: 10px 0;
}

.podium-score {
    font-size: 1.5em;
    font-weight: bold;
}

#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

#leaderboard-table th, #leaderboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

#leaderboard-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.leaderboard-actions {
    text-align: center;
    margin-top: 30px;
}

/* 儿童友好的动画效果 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 趣味元素 */
.star {
    position: absolute;
    background-color: #ffd700;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.heart {
    position: absolute;
    background-color: #e74c3c;
    clip-path: path('M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z');
}